﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="KhachHang.aspx.cs" Inherits="Admin_KhachHang" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
     <link href="../CSS/style.css" rel="stylesheet" type="text/css" />
        <script src="../JS/jscal2.js" type="text/javascript"></script>
    <link href="../css/jscal2.css" rel="stylesheet" type="text/css" />
    <link href="../css/border-radius.css" rel="stylesheet" type="text/css" />
    <script src="../JS/lang/vi.js" type="text/javascript"></script>
    <style type="text/css">

td.head
{
    font-weight: bold;
    font-size: 9pt;
    font-family: Tahoma;
    background-color: #fff1d7;
}
	
td
{
    font-size: 10pt;
    color: #000000;
    font-family: Tahoma;
}

.icl, .icsl
{
	background-image:url(../Images/Testing/calendar_16.png);
}

a.icse, a.icsd, a.icss, a.icsc, a.icsa, a.icsm, .icsw, .icsr, .icsi, .icst, .icsu, .icsl, .icsk, .icsn
{
	width:16px!important;
	line-height:16px!important;
	text-decoration:none!important;
	display:inline-block;
	vertical-align:middle!important;
	background-repeat:no-repeat;
	background-position:center center!important;
}

a
{
    color: #3c7faf;
    text-decoration: none;
    font-size: 9pt;
    font-family: Arial;
    border-top-style: none;
    border-right-style: none;
    border-left-style: none;
    border-bottom-style: none;
    font-weight: bold;
}

.icsa, .ica
{
	background-image:url(../Images/Testing/plus_16.png);
}

.ice, .icd, .ics, .icc, .ica, .icm, .icf, .ict, .icb, .icn, .ick, .icp, .icl, .ici, .icu
{
	padding-left:22px;
	padding-top:1px;
	padding-bottom:1px;
	padding-right:3px;
	font-weight:bold;
	background-repeat:no-repeat;
	background-position: 5px center;
}

.icsc, .icc
{
	background-image:url(../Images/Testing/block_16.png);
}

td.header
{
    font-weight: bold;
    font-size: 10pt;
    background-image: url(../Images/tabbg.jpg);
    color: #181818;
    padding-right: 5px;
    font-family: Arial;
    height: 22px;
    background-color: transparent;
    text-align: left;
    letter-spacing: normal;
    padding-left: 5px;
    vertical-align: middle;
    background-position-y: bottom;
    background-repeat: repeat-x;
}

        .style1
        {
            height: 33px;
        }
        .style2
        {
            width: 17%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <table cellpadding="4" cellspacing="0" style="width: 100%; text-align: left;">
            <tr>
                <td class="head" colspan="4" align="center" style="height: 21px">
                    QUẢN LÝ KHÁCH HÀNG</td>
            </tr>
            <tr>
                <td class="style2">
                    Mã Khách Hàng<asp:RequiredFieldValidator ID="RequiredFieldValidator7" 
                        runat="server" ControlToValidate="txtmakhachhang" Display="Dynamic" 
                        ErrorMessage="(*)" ValidationGroup="reg"></asp:RequiredFieldValidator></td>
                <td width="35%">
                    <asp:TextBox ID="txtmakhachhang" runat="server" Width="95%"></asp:TextBox>
                </td>
                <td>
                        Tên đăng nhập<asp:RequiredFieldValidator ID="RequiredFieldValidator8" 
                        runat="server" ControlToValidate="txtngaysinh" Display="Dynamic" 
                        ErrorMessage="(*)" ValidationGroup="reg"></asp:RequiredFieldValidator></td>
                <td>
                    <asp:TextBox ID="txttendangnhap" runat="server" Width="95%"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Họ tên KH<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                        ControlToValidate="txttenkh" Display="Dynamic" ErrorMessage="(*)" 
                        ValidationGroup="reg"></asp:RequiredFieldValidator></td>
                <td width="35%">
                    <asp:TextBox ID="txttenkh" runat="server" Width="95%"></asp:TextBox>
                </td>
                    <td class="style2">
                    Mât khẩu<asp:RequiredFieldValidator ID="rqmatkhau" 
                        runat="server" ControlToValidate="txtmatkhau" Display="Dynamic" 
                        ErrorMessage="(*)" ValidationGroup="reg"></asp:RequiredFieldValidator></td>
                <td>
                    <asp:TextBox ID="txtmatkhau" runat="server" Width="95%" TextMode="Password" 
                        ontextchanged="txtmatkhau_TextChanged"></asp:TextBox>
                    </td>
            </tr>
            <tr>
                <td class="style1">
                    Ngày sinh<asp:RequiredFieldValidator ID="RequiredFieldValidator5" 
                        runat="server" ControlToValidate="txttendangnhap" Display="Dynamic" 
                        ErrorMessage="(*)" ValidationGroup="reg"></asp:RequiredFieldValidator></td>
                <td class="style1">
                    <asp:TextBox ID="txtngaysinh" runat="server" Width="70%"></asp:TextBox>
                    <a id="Lnk_ngaysinh" class="icsl" href="javascript:;">&nbsp;</a>
                    <script type="text/javascript">
                        Calendar.setup({
                        inputField: "<%= txtngaysinh.ClientID %>",
                            dateFormat  : "%d/%m/%Y",
                            trigger: "Lnk_ngaysinh",
                            titleFormat : "%B, %Y",
                            onSelect   : function() { this.hide() }
                        });</script>
                </td>
                <td>
                    Nhập lại mật khẩu<asp:RequiredFieldValidator ID="rqnhaplaimatkhau" 
                        runat="server" ControlToValidate="txtnhaplaimatkhau" Display="Dynamic" 
                        ErrorMessage="(*)" ValidationGroup="reg"></asp:RequiredFieldValidator><asp:CompareValidator 
                        ID="CompareValidator1" runat="server" ControlToCompare="txtmatkhau" 
                        ControlToValidate="txtnhaplaimatkhau" ErrorMessage="(*)" 
                        ToolTip="Vui lòng nhập lại đúng thông tin mật khẩu" ValidationGroup="reg"></asp:CompareValidator></td>
                        <td>
                    <asp:TextBox ID="txtnhaplaimatkhau" runat="server" Width="95%" TextMode="Password"></asp:TextBox>
                        </td>
            </tr>
            <tr>
                <td class="style2">
                    Địa chỉ</td>
                <td>
                    <asp:TextBox ID="txtdiachi" runat="server" Width="95%"></asp:TextBox>
                </td>
                <td class="style2">
                    Số điện thoại&nbsp;
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                        ControlToValidate="txtsodienthoai" 
                        ErrorMessage="Nhập dạng số trong khoảng [0-9]" 
                        ValidationExpression="([0-9])*" ValidationGroup="reg"></asp:RegularExpressionValidator>
&nbsp;</td>
                <td>
                    <asp:TextBox ID="txtsodienthoai" runat="server" Width="95%"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                        Email<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" 
                            ControlToValidate="txtemail" Display="Dynamic" ErrorMessage="(*)" 
                            ToolTip="Vui lòng nhập email" ValidationGroup="reg"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                            ControlToValidate="txtemail" ErrorMessage="(*)" 
                            ToolTip="Vui lòng nhập đúng thông tin email" 
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                            ValidationGroup="reg"></asp:RegularExpressionValidator>
                </td>
                <td>
                    <asp:TextBox ID="txtemail" runat="server" Width="95%"></asp:TextBox>
                </td>
                <td class="style1">
                    Ngày Đăng Ký<asp:RequiredFieldValidator ID="RequiredFieldValidator10" 
                        runat="server" ControlToValidate="txttendangnhap" Display="Dynamic" 
                        ErrorMessage="(*)" ValidationGroup="reg"></asp:RequiredFieldValidator></td>
                <td class="style1">
                    <asp:TextBox ID="txtngaydangky" runat="server" Width="70%"></asp:TextBox>
                    <a id="Lnk_ngaysinh0" class="icsl" href="javascript:;">&nbsp;</a>
                    <script type="text/javascript">
                        Calendar.setup({
                            inputField: "<%= txtngaydangky.ClientID %>",
                            dateFormat  : "%d/%m/%Y",
                            trigger: "Lnk_ngaysinh0",
                            titleFormat : "%B, %Y",
                            onSelect   : function() { this.hide() }
                        });</script>
                </td>
            </tr>
            <tr>
                <td>
                        &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td class="style2">
                    &nbsp;</td>
                <td>
                    <asp:Button ID="btnthem" runat="server" CssClass="ica" Text="Thêm" 
                        onclick="btnthem_Click" ValidationGroup="reg" />
                    <asp:Button ID="btnboqua" runat="server" CssClass="icc" Text="Bỏ qua" 
                        onclick="btnboqua_Click" />
                </td>
            </tr>
            <tr>
                <td colspan="4" class="header">
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="4">
                    <asp:GridView ID="grvds" runat="server" AutoGenerateColumns="False" 
                        DataSourceID="dskhachhang" meta:resourcekey="grvdsResource1" Width="100%" 
                        onselectedindexchanged="grvds_SelectedIndexChanged" CellPadding="4" 
                        ForeColor="#333333" GridLines="None">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:TemplateField HeaderText="STT" meta:resourcekey="TemplateFieldResource1">
                                <ItemStyle HorizontalAlign="Center" Width="3%" />
                                <ItemTemplate>
                                    <%#Container.DataItemIndex+1 %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Mã khách hàng">
                                <ItemTemplate>
                                    <asp:Label ID="lbmakh" runat="server" Text='<%# Eval("Makh") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tên khách hàng">
                                <ItemTemplate>
                                    <asp:Label ID="lbtenkh" runat="server" Text='<%# Eval("tenkhachhang") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Ngày sinh">
                                <ItemTemplate>
                                    <asp:Label ID="lbngaysinh" runat="server" 
                                        Text='<%# Eval("ngaysinh", "{0:dd/MM/yyyy}") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle Width="7%" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Số điện thoại">
                                <ItemTemplate>
                                    <asp:Label ID="lbsdt" runat="server" Text='<%# Eval("sodienthoai") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Email">
                                <ItemTemplate>
                                    <asp:Label ID="lbemail" runat="server" Text='<%# Eval("email") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Địa chỉ">
                                <ItemTemplate>
                                    <asp:Label ID="lbdiachi" runat="server" Text='<%# Eval("diachi") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tên đăng nhập">
                                <ItemTemplate>
                                    <asp:Label ID="lbtendn" runat="server" Text='<%# Eval("tendangnhap") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>                            
                            <asp:TemplateField HeaderText="Mật khẩu">
                                <ItemTemplate>
                                    <asp:Label ID="lbmk" runat="server" Text='<%# Eval("matkhau") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                             <asp:TemplateField HeaderText="Ngày đăng ký">
                                <ItemTemplate>
                                    <asp:Label ID="lbngaydangky" runat="server" 
                                        Text='<%# Eval("ngaydangky", "{0:dd/MM/yyyy}") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle Width="7%" />
                            </asp:TemplateField>
                            <asp:TemplateField 
                                meta:resourcekey="TemplateFieldResource3">
                                <ItemTemplate>
                                    <asp:ImageButton ID="imgsua" runat="server" 
                                        CommandArgument='<%# Eval("id_row") %>' 
                                        ImageUrl="~/Images/Testing/pencil_16.png" onclick="imgsua_Click" 
                                        ToolTip="Sửa" />
                                    <asp:ImageButton ID="imgxoa" runat="server" 
                                        CommandArgument='<%# Eval("id_row") %>' 
                                        ImageUrl="~/Images/Testing/delete_16.png" onclick="imgxoa_Click" 
                                        onclientclick="return confirm('Bạn có chắc muốn xóa?')" ToolTip="Xóa" />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" Width="7%" />
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                        <SortedAscendingCellStyle BackColor="#FDF5AC" />
                        <SortedAscendingHeaderStyle BackColor="#4D0000" />
                        <SortedDescendingCellStyle BackColor="#FCF6C0" />
                        <SortedDescendingHeaderStyle BackColor="#820000" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="dskhachhang" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:WebbanhangConnectionString %>" 
                        SelectCommand="SELECT * FROM [KhachHang]" 
                        
                        ProviderName="<%$ ConnectionStrings:WebbanhangConnectionString.ProviderName %>"></asp:SqlDataSource>
                </td>
            </tr>
        </table>
    
    </div>
    <p>
    <asp:Label ID="lbid" runat="server" Visible="False"></asp:Label>
    </p>
    </form>
</body>
</html>
